package com.zjuee.web.tporder.service.impl.handledata;

import com.zjuee.core.translation.handledata.impl.AbstractDataHandler;
import com.zjuee.vo.WkTransOrderMaterialVo;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component("transOrderHandle")
public class TransOrderHandle extends AbstractDataHandler {
    @Override
    public <T> T getData(T data, Map<Object, Object> map, String... str) {

        WkTransOrderMaterialVo wkTransOrderMaterialVo = (WkTransOrderMaterialVo) data;
        wkTransOrderMaterialVo.setWtomXtStr(map.get(wkTransOrderMaterialVo.getWtomXt() +str[0]) == null? "":map.get(wkTransOrderMaterialVo.getWtomXt()+str[0]).toString());
        wkTransOrderMaterialVo.setWtomBzStr(map.get(wkTransOrderMaterialVo.getWtomBz() +str[1]) == null? "":map.get(wkTransOrderMaterialVo.getWtomBz()+str[1]).toString());
        wkTransOrderMaterialVo.setWtomLyczfsStr(map.get(wkTransOrderMaterialVo.getWtomLyczfs() +str[2]) == null? "":map.get(wkTransOrderMaterialVo.getWtomLyczfs()+str[2]).toString());

        return (T) wkTransOrderMaterialVo;
    }
}
